<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <style>

        /*找id为list底下的第三个儿子  而且这个儿子得是.item*/
        /*#list .item:nth-child(3){
            color: red;
        }*/


        /*找id为list底下的第四个item*/
        /*nth-of-type 以元素为中心*/
        /*#list .item:nth-of-type(4){
            color: red;
        }*/

        #list li:nth-of-type(4){
            color: red;
        }
        #list div:nth-of-type(4){
            color: red;
        }
    </style>
</head>
<body>
    <ul id="list">
        <li class="item">1</li>
        <li class="item">2</li>
        <div class="item">xxxx</div>
        <div class="item">xxxx</div>
        <div class="item">xxxx</div>
        <div class="item">xxxx</div>
        <li class="item">3</li>
        <li class="item">4</li>
        <li class="item">5</li>
        <li class="item">6</li>
    </ul>
</body>
</html>